package api_day03;
/*
    StringBuilder课堂练习
 */
public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder sb1 = new StringBuilder("ABCDE");
        for (int i = 0; i < sb1.length() - 2; i+=2) {
            sb1.insert(i+1,",");
        }
        sb1.deleteCharAt(sb1.length()-1);
        System.out.println(sb1);
        System.out.println("----------------------------");
        StringBuilder sb2 = new StringBuilder("asdSADWdsaWDSasWdsW");
        for (int i = 0; i < sb2.length(); i++) {
            if (sb2.charAt(i) >= 'A' & sb2.charAt(i) <= 'Z'){
                System.out.print(sb2.charAt(i));
            }
        }
        for (int i = 0; i < sb2.length(); i++) {
            if (sb2.charAt(i) >= 'a' & sb2.charAt(i) <= 'z'){
                System.out.print(sb2.charAt(i));
            }
        }
        System.out.println();
    }
}
